package com.wangshouyu.mp.message;

import com.thoughtworks.xstream.annotations.XStreamAlias;

import java.util.List;
import java.util.Objects;

/**
 * @author 王守钰
 * @date 2020年12月07日 11:21
 * @description 响应文章消息
 */
@XStreamAlias("xml")
public class ResponseArticleMessage extends BaseMessage{

    /**
     * 图文
     */
    @XStreamAlias("Articles")
    private List<ArticleMessage> articles;

    /**
     * 图文数目
     */
    @XStreamAlias("ArticleCount")
    private Integer articleCount;

    public List<ArticleMessage> getArticles() {
        return articles;
    }

    public void setArticles(List<ArticleMessage> articles) {
        this.articles = articles;
    }

    public Integer getArticleCount() {
        return articleCount;
    }

    public void setArticleCount(Integer articleCount) {
        this.articleCount = articleCount;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        ResponseArticleMessage that = (ResponseArticleMessage) o;
        return Objects.equals(articles, that.articles) &&
                Objects.equals(articleCount, that.articleCount);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), articles, articleCount);
    }

    @Override
    public String toString() {
        super.toString();
        return "ResponseArticleMessage{" +
                "articles=" + articles +
                ", articleCount=" + articleCount +
                '}';
    }
}
